import {
  get,
  post
} from '@/utils/request.js'
import {BaseURL} from '@/config/index.js'
/**
 * 订单详情
 * id:
 */
export const getOrderDetail = (data) => {
  return get(`/order/detail`, data)
}
// 订单列表
export const getOrderPageList = (data) => {
  return get(`/order/page`, data)
}
// 核销列表-商品
export const pageVerifyGoods = (data) => {
  return get(`/order/pageVerifyGoods`, data)
}
// 核销列表
export const pageVerifyRecord = (data) => {
  return get(`/order/pageVerifyRecord`, data)
}
// 核销记录: 商品核销记录明细
export const pageVerifyGoodsDetail = (data) => {
  return get(`/order/pageVerifyGoodsDetail`, data)
}
// 核销码获取信息
export const getByVerifyCode = (data, option = {}) => {
  return get(`/order/getByVerifyCode`, data, option)
}
// 确认核销
export const submitVerifyByCode = (data) => {
  return post(`/order/verify`, data)
}
// 打印报名信息
export const printEnrollInfo = (data) => {
  return get(`/order/printEnrollInfo`, data)
}
// 首页数据统计
export const statistics = (data) => {
  return get(`/index/statistics`, data)
}
// 订单导出
export const exportApi = (data) => {
	let params = ''
	for (const key in data) {
		if (data.hasOwnProperty(key)) {
			params += `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}&`
		}
	}
	return `${BaseURL}/order/export?${params}`
}